<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#222" media="(prefers-color-scheme: dark)"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/favicon.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon.ico">
  <link rel="mask-icon" href="/favicon.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="/lib/@fortawesome/fontawesome-free/css/all.min.css" integrity="sha256-5eIC48iZUHmSlSUz9XtjRyK2mzQkHScZY1WdMaoz74E=" crossorigin="anonymous">
  <link rel="stylesheet" href="/lib/animate.css/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"blog.dqv5.com","root":"/","images":"/images","scheme":"Mist","darkmode":true,"version":"8.21.1","exturl":false,"sidebar":{"position":"right","width_expanded":320,"width_dual_column":240,"display":"always","padding":18,"offset":12},"hljswrap":true,"copycode":{"enable":true,"style":null},"fold":{"enable":true,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"gitalk","storage":true,"lazyload":false,"nav":null,"activeClass":"gitalk"},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"top_n_per_article":1,"unescape":false,"preload":false,"trigger":"auto"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="综合考虑了几种博客平台方案，最终确定了适合自己的个人博客平台">
<meta property="og:type" content="article">
<meta property="og:title" content="搭建个人博客的方案选择">
<meta property="og:url" content="http://blog.dqv5.com/2023/02/18/blog-deploy/index.html">
<meta property="og:site_name" content="dqv5.com">
<meta property="og:description" content="综合考虑了几种博客平台方案，最终确定了适合自己的个人博客平台">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://image.dqv5.com/public/2023/02/19/1676786285198.png">
<meta property="article:published_time" content="2023-02-18T21:12:05.000Z">
<meta property="article:modified_time" content="2024-11-23T11:58:37.867Z">
<meta property="article:author" content="du qian">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://image.dqv5.com/public/2023/02/19/1676786285198.png">


<link rel="canonical" href="http://blog.dqv5.com/2023/02/18/blog-deploy/">


<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://blog.dqv5.com/2023/02/18/blog-deploy/","path":"2023/02/18/blog-deploy/","title":"搭建个人博客的方案选择"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>搭建个人博客的方案选择 | dqv5.com</title>
  

  <script src="/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?1752ae624eedea5ce859335ad2f0e657"></script>







  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">dqv5.com</p>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">49</span></a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">20</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">61</span></a></li><li class="menu-item menu-item-留言板"><a href="/message-board/" rel="section"><i class="fa fa-comments fa-fw"></i>留言板</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
      <div class="search-header">
        <span class="search-icon">
          <i class="fa fa-search"></i>
        </span>
        <div class="search-input-container">
          <input autocomplete="off" autocapitalize="off" maxlength="80"
                placeholder="搜索..." spellcheck="false"
                type="search" class="search-input">
        </div>
        <span class="popup-btn-close" role="button">
          <i class="fa fa-times-circle"></i>
        </span>
      </div>
      <div class="search-result-container">
        <div class="search-result-icon">
          <i class="fa fa-spinner fa-pulse fa-5x"></i>
        </div>
      </div>
    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%89%8D%E8%A8%80"><span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%87%A0%E7%A7%8D%E5%8F%AF%E9%80%89%E6%96%B9%E6%A1%88"><span class="nav-text">几种可选方案</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9C%A8%E7%BA%BF%E5%8D%9A%E5%AE%A2-%E7%AC%94%E8%AE%B0-%E6%96%87%E6%A1%A3%E5%B9%B3%E5%8F%B0"><span class="nav-text">在线博客&#x2F;笔记&#x2F;文档平台</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%87%AA%E5%B7%B1%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2%E5%B9%B3%E5%8F%B0"><span class="nav-text">自己搭建博客平台</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%83%A8%E7%BD%B2"><span class="nav-text">部署</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%86%99%E4%BD%9C"><span class="nav-text">写作</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%BE%E5%BA%8A"><span class="nav-text">图床</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="du qian"
      src="/images/soccer.jpg">
  <p class="site-author-name" itemprop="name">du qian</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">61</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">20</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">49</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/duqian42707" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;duqian42707" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/duqian42707" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;duqian42707" rel="noopener me" target="_blank"><i class="fab fa-stack-overflow fa-fw"></i>StackOverflow</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/duqian42707" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;duqian42707" rel="noopener me" target="_blank"><i class="fas fa-link fa-fw"></i>CSDN</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://duqian42707.github.io/qiniu-host" title="图床 → https:&#x2F;&#x2F;duqian42707.github.io&#x2F;qiniu-host" rel="noopener me" target="_blank"><i class="far fa-image fa-fw"></i>图床</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://blog.dqv5.com/2023/02/18/blog-deploy/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/soccer.jpg">
      <meta itemprop="name" content="du qian">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="dqv5.com">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="搭建个人博客的方案选择 | dqv5.com">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          搭建个人博客的方案选择
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-02-18 21:12:05" itemprop="dateCreated datePublished" datetime="2023-02-18T21:12:05+00:00">2023-02-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2024-11-23 11:58:37" itemprop="dateModified" datetime="2024-11-23T11:58:37+00:00">2024-11-23</time>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>摘要：综合考虑了几种博客平台方案，最终确定了适合自己的个人博客平台</p>
<!-- more -->

<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>作为一个程序员，养成写技术博客的习惯是很不错的。个人认为一个好的博客系统应该具备下列特性：</p>
<ul>
<li>支持 Markdown 语法</li>
<li>服务稳定，访问速度不能太慢</li>
<li>支持分类、搜索</li>
<li>页面简洁，无广告，以内容为主</li>
</ul>
<p>如果还能有下面的特性就更好了：</p>
<ul>
<li>支持代码块语法高亮</li>
<li>代码块复制方便</li>
<li>支持评论、回复</li>
</ul>
<h2 id="几种可选方案"><a href="#几种可选方案" class="headerlink" title="几种可选方案"></a>几种可选方案</h2><h3 id="在线博客-笔记-文档平台"><a href="#在线博客-笔记-文档平台" class="headerlink" title="在线博客&#x2F;笔记&#x2F;文档平台"></a>在线博客&#x2F;笔记&#x2F;文档平台</h3><p>如CSDN、语雀、有道云笔记等。这些平台是最简单省事的，注册个账号就能直接使用，而且可以随时随地在线写作、发布。但是他们的缺点也比较明显：</p>
<p>CSDN中间的文章主体部分太窄，两侧的元素太多，而且有时顶部有很大块的广告，而且有的文章需要关注后才能看全文。</p>
<p>语雀则是页面加载比较慢，已经到了没法忍受的程度。</p>
<p>有道云笔记没有尝试，不做评价。</p>
<p>最关键的一点，在这些平台写好的文章都是保存到平台内的，没办法直接将Markdown源文件保存到自己的位置。这样就导致切换平台的成本比较高。</p>
<p>考虑之后还是决定自己搭建博客平台。</p>
<h3 id="自己搭建博客平台"><a href="#自己搭建博客平台" class="headerlink" title="自己搭建博客平台"></a>自己搭建博客平台</h3><p>自己搭建的平台优点：</p>
<ul>
<li>数据都掌握在自己手里，可随意使用、更改</li>
<li>简洁无广告</li>
</ul>
<p>缺点：</p>
<ul>
<li>需要自己动手折腾，搭建过程可能会遇到各种问题</li>
<li>可能需要买服务器、带宽、域名等基础设施，需要花钱</li>
<li>稳定性差。访问量少还可以，如果访问量很大，或是被黑客攻击，可能导致无法正常提供服务。</li>
</ul>
<p>自己搭建的又可分为有后台和无后台的。</p>
<ul>
<li>有后台的比如：<a target="_blank" rel="noopener" href="https://wordpress.com/">WordPress</a>、<a target="_blank" rel="noopener" href="https://github.com/halo-dev/halo">Halo</a>。</li>
<li>无后台的如：<a target="_blank" rel="noopener" href="https://jekyllrb.com/">Jekyll</a>、<a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a></li>
</ul>
<p>有后台的一般是把文章数据存到数据库中，通过web页面编辑文章、发布，对服务器性能有一定的要求。</p>
<p>无后台的一般是在本地编辑 Markdown 文件，再将 Markdown 文件生成静态 html 文件，再去部署静态网站即可。</p>
<p>我选择的是无后台的工具：Hexo</p>
<h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h2><p>由于最后生成的是纯静态页面，所以部署就有很多种可能性了，比如：</p>
<ul>
<li>GitHub Pages服务（国内访问慢）</li>
<li>Gitee Pages服务（比较不错的方案，需要实名认证，正在尝试）</li>
<li>七牛云、又拍云等对象存储服务（七牛云https花钱，又拍云免费但是有流量额度限制，而且站点文件更新不方便）</li>
<li>购买云服务器进行部署（很好，灵活性足够，带宽可能不够）</li>
</ul>
<p>最终我的部署方案是源Markdown文件提交到 GitHub ，利用 Github Actions 功能编写一个自动部署脚本。当master分支有内容提交时，触发脚本：</p>
<ol>
<li>编译成html文件</li>
<li>将编译后的文件提交到gh-pages分支</li>
<li>再将gh-pages分支提交到 Gitee</li>
<li>触发一个webhook，通知我的服务器，从 Gitee 上拉取最新gh-pages分支内容</li>
</ol>
<p>（如果不用自己的服务器，只是通过Gitee Pages提供服务，那么第4步可以不要。）</p>
<p>这样写完文章后，只需将源文件提交就可以自动部署更新了。</p>
<p><code>.github/workflows/deploy-pages.yml</code></p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">name:</span> <span class="string">Deploy</span> <span class="string">to</span> <span class="string">Github</span> <span class="string">Pages</span> <span class="string">and</span> <span class="string">Gitee</span> <span class="string">Pages</span></span><br><span class="line"><span class="attr">on:</span></span><br><span class="line">  <span class="attr">push:</span></span><br><span class="line">    <span class="attr">branches:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">master</span></span><br><span class="line"><span class="attr">jobs:</span></span><br><span class="line">  <span class="attr">build-and-deploy:</span></span><br><span class="line">    <span class="attr">runs-on:</span> <span class="string">ubuntu-latest</span></span><br><span class="line">    <span class="attr">steps:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Checkout</span> <span class="string">Branch</span> <span class="string">Master</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/checkout@master</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Use</span> <span class="string">Node.js</span> <span class="number">18.</span><span class="string">x</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/setup-node@v2</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">node-version:</span> <span class="string">&#x27;18&#x27;</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Cache</span> <span class="string">NPM</span> <span class="string">dependencies</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/cache@v2</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">path:</span> <span class="string">node_modules</span></span><br><span class="line">          <span class="attr">key:</span> <span class="string">$&#123;&#123;</span> <span class="string">runner.OS</span> <span class="string">&#125;&#125;-npm-cache</span></span><br><span class="line">          <span class="attr">restore-keys:</span> <span class="string">|</span></span><br><span class="line"><span class="string">            $&#123;&#123; runner.OS &#125;&#125;-npm-cache</span></span><br><span class="line"><span class="string"></span>      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Install</span> <span class="string">Dependencies</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">npm</span> <span class="string">install</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Build</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">npm</span> <span class="string">run</span> <span class="string">build</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Deploy</span> <span class="string">to</span> <span class="string">Github</span> <span class="string">Pages</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">peaceiris/actions-gh-pages@v3</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">github_token:</span> <span class="string">$&#123;&#123;</span> <span class="string">secrets.GITHUB_TOKEN</span> <span class="string">&#125;&#125;</span></span><br><span class="line">          <span class="attr">publish_dir:</span> <span class="string">./public</span></span><br><span class="line">  <span class="attr">mirroring-gitee:</span></span><br><span class="line">    <span class="attr">needs:</span> <span class="string">build-and-deploy</span></span><br><span class="line">    <span class="attr">runs-on:</span> <span class="string">ubuntu-latest</span></span><br><span class="line">    <span class="attr">steps:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Checkout</span> <span class="string">Branch</span> <span class="string">gh-pages</span></span><br><span class="line">        <span class="attr">uses:</span> <span class="string">actions/checkout@v3</span></span><br><span class="line">        <span class="attr">with:</span></span><br><span class="line">          <span class="attr">ref:</span> <span class="string">&#x27;gh-pages&#x27;</span></span><br><span class="line">          <span class="attr">fetch-depth:</span> <span class="number">0</span></span><br><span class="line">      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Push</span> <span class="string">to</span> <span class="string">Gitee</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line"><span class="string">          mkdir ~/.ssh</span></span><br><span class="line"><span class="string">          ssh-keyscan -H gitee.com &gt;&gt; ~/.ssh/known_hosts</span></span><br><span class="line"><span class="string">          echo &quot;$&#123;&#123; secrets.GITEE_SSH_PRIVATE_KEY &#125;&#125;&quot; &gt; ~/.ssh/id_rsa_gitee</span></span><br><span class="line"><span class="string">          chmod 600 ~/.ssh/id_rsa_gitee</span></span><br><span class="line"><span class="string">          echo &quot;Host gitee.com</span></span><br><span class="line"><span class="string">            HostName gitee.com</span></span><br><span class="line"><span class="string">            User git</span></span><br><span class="line"><span class="string">            IdentityFile ~/.ssh/id_rsa_gitee</span></span><br><span class="line"><span class="string">            IdentitiesOnly yes&quot; &gt;&gt; ~/.ssh/config</span></span><br><span class="line"><span class="string">          git config --global user.name &quot;Github Actions&quot;</span></span><br><span class="line"><span class="string">          git config --global user.email &quot;noreply@github.com&quot;</span></span><br><span class="line"><span class="string">          git checkout --orphan e3a3bcbf11db4c5e9199e81e21e3d7cf</span></span><br><span class="line"><span class="string">          git add -A</span></span><br><span class="line"><span class="string">          git commit -m &quot;deploy&quot;</span></span><br><span class="line"><span class="string">          git branch -d gh-pages</span></span><br><span class="line"><span class="string">          git branch -m gh-pages</span></span><br><span class="line"><span class="string">          git remote add gitee git@gitee.com:dq07/blog.git</span></span><br><span class="line"><span class="string">          git push --force gitee gh-pages</span></span><br><span class="line"><span class="string"></span>      <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">Post</span> <span class="string">Webhook</span></span><br><span class="line">        <span class="attr">run:</span> <span class="string">|</span></span><br><span class="line">          <span class="string">curl</span> <span class="string">https://blog.dqv5.com/deploy?token=e9e8038a09464231bd637fd6824d3d14</span></span><br></pre></td></tr></table></figure>

<h2 id="写作"><a href="#写作" class="headerlink" title="写作"></a>写作</h2><p>部署的问题解决了，下面考虑写作的问题。由于没有在线编辑的功能，所有的文章都需要手动在本地编辑，编辑好之后提交到Github。</p>
<p>这样做的缺点就是：每到一个新的电脑上，就得重新clone代码仓库，npm install安装环境，还要打开Markdown编辑器进行编辑。能不能像CSDN等平台，随时随地在线编辑呢？</p>
<p>我找到了这个工具：<a target="_blank" rel="noopener" href="https://github.com/coder/code-server">code-server</a>。这是一个在线的 VS Code 编辑器，再自己的服务器上部署好程序，就能在浏览器里写代码了。</p>
<p><img src="https://image.dqv5.com/public/2023/02/19/1676786285198.png"></p>
<p>我又添加了一个二级域名，用于在线编辑时随时预览博客效果，这样就可实现随时写作啦。</p>
<h2 id="图床"><a href="#图床" class="headerlink" title="图床"></a>图床</h2><p>图床使用的是又拍云的对象存储服务，使用的是另一个单独的域名。</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div>请我一杯咖啡吧！</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechatpay.jpg" alt="du qian 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/images/alipay.jpg" alt="du qian 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>


        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/02/16/chrome-network-stalled/" rel="prev" title="Stalled时间过长导致的网页响应缓慢的排查记录">
                  <i class="fa fa-angle-left"></i> Stalled时间过长导致的网页响应缓慢的排查记录
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2023/10/13/page-info-util/" rel="next" title="手动分页构造 PageInfo 对象">
                  手动分页构造 PageInfo 对象 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    <div class="comments gitalk-container"></div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">冀ICP备17034993号-1 </a>
  </div>
  <div class="copyright">
    &copy; 2016 – 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">du qian</span>
  </div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/mist/" rel="noopener" target="_blank">NexT.Mist</a> 强力驱动
  </div>
  <div class="upyun-league">
    本网站由<a target="_blank" rel="noopener" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" style="border-bottom: none;">
      <img src="/images/upyun_logo.png" alt="又拍云" style="display: inline;height: 30px;vertical-align: bottom;"/>
    </a>提供CDN加速/云存储服务
  </div>


    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/duqian42707" class="github-corner" title="在 GitHub 上关注我" aria-label="在 GitHub 上关注我" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="/lib/animejs/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/sidebar.js"></script><script src="/js/next-boot.js"></script>

  <script src="/lib/hexo-generator-searchdb/dist/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>


  <script class="next-config" data-name="mermaid" type="application/json">{"enable":true,"theme":"forest","js":{"url":"/lib/mermaid/dist/mermaid.min.js","integrity":"sha256-G8ouPAnw4zzMbnAenHnVz6h9XpKbNdOkrqTh7AadyHs="}}</script>
  <script src="/js/third-party/tags/mermaid.js"></script>





  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<link rel="stylesheet" href="/lib/gitalk/dist/gitalk.css" integrity="sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U=" crossorigin="anonymous">

<script class="next-config" data-name="gitalk" type="application/json">{"enable":true,"github_id":"duqian42707","repo":"blog-comment","client_id":"c9f48bc2fea3d4ce5d93","client_secret":"154d6227d3d7b532b36bfc1ce030121f0263ac90","admin_user":"duqian42707","distraction_free_mode":false,"proxy":"https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token","language":"zh-CN","js":{"url":"/lib/gitalk/dist/gitalk.min.js","integrity":"sha256-MVK9MGD/XJaGyIghSVrONSnoXoGh3IFxLw0zfvzpxR4="},"path_md5":"3d82174d2982356d177c9da5f0cf5265"}</script>
<script src="/js/third-party/comments/gitalk.js"></script>

</body>
</html>
